<%-- 
    Document   : cadContrato
    Created on : 11/03/2011, 15:36:13
    Author     : UpTech
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!-- Declaração das Tags da biblioteca RichFaces -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<f:view>
    <style type="text/css" >
        .cols{
            vertical-align:top;
        }
        .barsearchbutton {
            border-width:1px;

        }
    </style>
    <style>
        .pic{
            margin-bottom: -4px;
            margin-right: 2px;
        }

    </style>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link href="../css/estilomodelo.css" rel="stylesheet" type="text/css" />

            <title>CADASTRO DE CONTRATO | Sistema Gestão de Suprimentos - SGS 1.0</title>
        </head>
        <body>
            <div id="container">
                <div id="banner"></div>
                <div  id="conteudoCad">
                    <rich:toolBar height="16" itemSeparator="grid">
                        <rich:toolBarGroup location="right">
                            <h:commandButton value="Voltar" onclick="javascript:window.location='../faces/principal.jsp'" styleClass="pic"/>
                        </rich:toolBarGroup>
                        <rich:toolBarGroup location="left">
                            <h:outputText value="Cadastro de Contrato"/>
                        </rich:toolBarGroup>
                    </rich:toolBar>
                    <rich:panel style="width:756px; height:216px; background-color:#FFFFFF;">
                        <a4j:form id="formContrato">
                            <h:panelGrid columns="3">
                                <h:outputText  value="Contrato: "/>
                                <h:inputText id="contrato" value="#{ObjFacadeContrato.contrato.objeto}" required="true" size="20"/>
                                <h:message showDetail="true "for="contrato"/>

                                <h:outputText value="Valor: "/>
                                <h:inputText id="valor" value="#{ObjFacadeContrato.contrato.valor}" required="true" size="20"/>
                                <h:message for="valor"/>

                                <h:outputText value="Inicio: "/>
                                <rich:calendar id="inicio" datePattern="dd/MM/yyyy" required="true" cellWidth="24px" cellHeight="22px" style="width: 200px" value="#{ObjFacadeContrato.contrato.inicio}" />
                                <rich:message for="inicio"/>

                                <h:outputText value="Termino: "/>
                                <rich:calendar id="termino" datePattern="dd/MM/yyyy" cellWidth="24px" required="true" cellHeight="22px" style="width: 200px" value="#{ObjFacadeContrato.contrato.termino}" />
                                <rich:message for="termino"/>

                                <a4j:commandButton value="Cadastro" action="#{ObjFacadeContrato.cadastrarContrato}" />

                            </h:panelGrid>
                        </a4j:form>
                    </rich:panel>

                </div><%--Conteúdo--%>
                <%------------TABELA------------------%>
                <div align="center" id="tableCad">
                    <h:form id="tabela">
                        <rich:dataTable style="width:740px;" id="contrato" border="1" value="#{ObjDAO.allContrato}" rendered="#{not empty ObjDAO.allContrato}"  var="c" rows="4">
                            <f:facet name="header">
                                <rich:columnGroup>
                                    <rich:column breakBefore="true">
                                        <h:outputText value="Alterar"/>
                                    </rich:column>
                                    <rich:column>
                                        <h:outputText value="Excluir"/>
                                    </rich:column>
                                    <rich:column>
                                        <h:outputText value="Contrato"/>
                                    </rich:column>
                                    <rich:column>
                                        <h:outputText value="Valor"/>
                                    </rich:column>
                                    <rich:column>
                                        <h:outputText value="Inicio"/>
                                    </rich:column>
                                    <rich:column>
                                        <h:outputText value="Termino"/>
                                    </rich:column>
                                </rich:columnGroup>
                            </f:facet>
                            <rich:column>
                                <center> <h:commandButton value="alterar" action="editar" image="../imagens/icon/alterar.gif" ></center>
                                    <f:setPropertyActionListener target="#{ObjFacadeContrato.contrato}" value="#{c}"/>
                                </h:commandButton>
                            </rich:column>
                            <rich:column>
                                <center> <h:commandButton value="excluir" action="#{ObjFacadeContrato.excluirContrato}" image="../imagens/icon/excluir.gif" ></center>
                                    <f:setPropertyActionListener target="#{ObjFacadeContrato.contrato}" value="#{c}"/>
                                </h:commandButton>
                            </rich:column>
                            <rich:column filterBy="#{c.objeto}" filterEvent="onkeyup" filterValue="">
                                <h:outputText value="#{c.objeto}"/>
                            </rich:column>
                            <rich:column filterBy="#{c.valor}" filterEvent="onkeyup" filterValue="">
                                <h:outputText value="#{c.valor}"/>
                            </rich:column>
                            <rich:column filterBy="#{c.inicio}" filterEvent="onkeyup" filterValue="">
                                <h:outputText  value="#{c.inicio}">
                                    <f:convertDateTime pattern="dd/MM/yyyy"/>
                                </h:outputText>
                            </rich:column>
                                 <rich:column filterBy="#{c.termino}" filterEvent="onkeyup" filterValue="">
                                <h:outputText  value="#{c.termino}">
                                    <f:convertDateTime pattern="dd/MM/yyyy"/>
                                </h:outputText>
                            </rich:column>
                                 <f:facet name="footer">
                                    <rich:datascroller id="ds" renderIfSinglePage="false"></rich:datascroller>
                                </f:facet>
                        </rich:dataTable>
                            <%--<h:form id="tabela">
                                <rich:dataTable style="width:740px;" id="contrato" border="1" value="#{ObjDAO.allContrato}" rendered="#{not empty ObjDAO.allContrato}"  var="c" rows="4">
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Alterar"/>
                                        </f:facet>
                                        <center> <h:commandButton value="alterar" action="editar" image="../imagens/icon/alterar.gif" ></center>
                                            <f:setPropertyActionListener target="#{ObjFacadeContrato.contrato}" value="#{c}"/>
                                        </h:commandButton>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Excluir"/>
                                        </f:facet>
                                        <center> <h:commandButton value="excluir" action="#{ObjFacadeContrato.excluirContrato}" image="../imagens/icon/excluir.gif" ></center>
                                            <f:setPropertyActionListener target="#{ObjFacadeContrato.contrato}" value="#{c}"/>
                                        </h:commandButton>
                                    </h:column>
                                    <f:facet name="footer">
                                        <rich:datascroller />
                                    </f:facet>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Contrato"/>
                                        </f:facet>
                                        <center> <h:outputText value="#{c.objeto}"/></center>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Valor"/>
                                        </f:facet>
                                        <center> <h:outputText value="#{c.valor}"/></center>
                                    </h:column>
                                    <h:column>
                                        <f:facet name="header">
                                            <h:outputText value="Inicio"/>
                                        </f:facet>
                                        <center><h:outputText  value="#{c.inicio}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText></center>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Termino"/>
                                            </f:facet>
                                        <center> <h:outputText value="#{c.termino}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText></center>
                                        </h:column>
                                    </rich:dataTable>--%>
                                </h:form>
                        </div><%--Tabela--%>
                        <div id="rodape">
                        </div><%--Rodapé--%>
                    </div><%--Container--%>
                </body>
            </html>

            </f:view>
